﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models {
    import flash.events.*;
    import flash.utils.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class UserModel extends Actor {

        public var tickModel:TickModel;
        public var sessionModel:SessionModel;
        public var pendingModel:PendingModel;
        private var _userName:String;
        private var _myFacebookID:String;
        private var _xpPoints:int;
        private var _coins:int;
        private var _level:int;
        private var _newUser:Boolean;
        private var _xpBounds:Array;
        private var _numberOfCuredPets:Number;
        private var _visitingFriendID:String;
        private var _zoomFactor:Number;
        private var _zoomTargetSlot:Number;
        private var _levelUpCoins:int;
        private var _items:Dictionary;
        private var _numberOfBirdsCollected:int;
        private var _numberOfUsedEnergy:int;
        private var _numberOfFedDoctors:int;
        private var _numberOfCuredElders:int;
        private var _numberOfCollectedSymbols:int;

        public function UserModel(){
            this._items = new Dictionary();
            super();
        }
        public function set xpBounds(_arg1:Array):void{
            this._xpBounds = _arg1;
        }
        public function get xpBounds():Array{
            return (this._xpBounds);
        }
        public function set newUser(_arg1:Boolean):void{
            this._newUser = _arg1;
        }
        public function get newUser():Boolean{
            return (this._newUser);
        }
        public function set userName(_arg1:String):void{
            this._userName = _arg1;
            dispatch(new Event(EventConstants.USERNAME_IS_SET));
        }
        public function get userName():String{
            return (this._userName);
        }
        public function set mySocialID(_arg1:String):void{
            this._myFacebookID = _arg1;
        }
        public function get mySocialID():String{
            return (this._myFacebookID);
        }
        public function isVisitFriendsMode():Boolean{
            return (Boolean(((this._visitingFriendID) && (!((this._visitingFriendID == this._myFacebookID))))));
        }
        public function set coins(_arg1:int):void{
            this._coins = _arg1;
        }
        public function get coins():int{
            return (this._coins);
        }
        public function setLevel(_arg1:Object):void{
            var _local2:int = int(_arg1.level_info.level);
            if (_local2 != this._level){
                this._level = _local2;
                if (((_arg1) && (_arg1.level_up))){
                    dispatch(new InfoEvent(GameEvent.LEVEL_UP, null, _arg1));
                };
            };
        }
        public function get level():int{
            return (this._level);
        }
        public function set xpPoints(_arg1:int):void{
            this._xpPoints = _arg1;
        }
        public function get xpPoints():int{
            return (this._xpPoints);
        }
        public function get numberOfCuredPets():Number{
            return (this._numberOfCuredPets);
        }
        public function set numberOfCuredPets(_arg1:Number):void{
            this._numberOfCuredPets = _arg1;
        }
        public function get visitingFriendID():String{
            return (((this._visitingFriendID) || (this._myFacebookID)));
        }
        public function set visitingFriendID(_arg1:String):void{
            this._visitingFriendID = _arg1;
        }
        public function get zoomFactor():Number{
            return (this._zoomFactor);
        }
        public function set zoomFactor(_arg1:Number):void{
            this._zoomFactor = _arg1;
        }
        public function get zoomTargetSlot():Number{
            return (this._zoomTargetSlot);
        }
        public function set zoomTargetSlot(_arg1:Number):void{
            this._zoomTargetSlot = _arg1;
        }
        public function set levelUpCoins(_arg1:int):void{
            this._levelUpCoins = _arg1;
        }
        public function get levelUpCoins():int{
            return (this._levelUpCoins);
        }
        public function get batteries():int{
            return (int(this._items[GameConstants.REWARD_BATTERY]));
        }
        public function set batteries(_arg1:int):void{
            this._items[GameConstants.REWARD_BATTERY] = _arg1;
        }
        public function get coffee():int{
            return (int(this._items[GameConstants.COFFEE]));
        }
        public function set coffee(_arg1:int):void{
            this._items[GameConstants.COFFEE] = _arg1;
        }
        public function get goods():int{
            return (int(this._items[GameConstants.GOODS]));
        }
        public function set goods(_arg1:int):void{
            this._items[GameConstants.GOODS] = _arg1;
        }
        public function setItemsByType(_arg1:String, _arg2:int):void{
            this._items[_arg1] = _arg2;
        }
        public function getItemsByType(_arg1:String):int{
            return (this._items[_arg1]);
        }
        public function isFull(_arg1:String):Boolean{
            if ((((_arg1 == GameConstants.REWARD_COFFEE)) || ((_arg1 == GameConstants.REWARD_COFFEE_PACK)))){
                _arg1 = GameConstants.COFFEE;
            };
            var _local2:int = this.pendingModel.getPendingItemCount(_arg1);
            return (((int(this._items[_arg1]) + _local2) >= GameConstants.MAX_INEVNTORY_ITEM_NUM));
        }
        public function set numberOfBirdsCollected(_arg1:int):void{
            this._numberOfBirdsCollected = _arg1;
        }
        public function set numberOfUsedEnergy(_arg1:int):void{
            this._numberOfUsedEnergy = _arg1;
        }
        public function set numberOfFedDoctors(_arg1:int):void{
            this._numberOfFedDoctors = _arg1;
        }
        public function set numberOfCuredElders(_arg1:int):void{
            this._numberOfCuredElders = _arg1;
        }
        public function set numberOfCollectedSymbols(_arg1:int):void{
            this._numberOfCollectedSymbols = _arg1;
        }
        public function get numberOfBirdsCollected():int{
            return (this._numberOfBirdsCollected);
        }
        public function get numberOfUsedEnergy():int{
            return (this._numberOfUsedEnergy);
        }
        public function get numberOfFedDoctors():int{
            return (this._numberOfFedDoctors);
        }
        public function get numberOfCuredElders():int{
            return (this._numberOfCuredElders);
        }
        public function get numberOfCollectedSymbols():int{
            return (this._numberOfCollectedSymbols);
        }

    }
}//package net.wooga.pets.models 
